package cn.bocai.pc.dao.imp;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import cn.bocai.pc.dao.BcLinktypeMapper;
import cn.bocai.pc.model.BcLinktype;
@Repository
public class BcLinktypeMapperImpl extends SqlSessionDaoSupport implements BcLinktypeMapper {
    String ns="cn.bocai.pc.dao.BcLinktypeMapper.";
    /**
	 * 查询能显示的友情链接类型
	 * @time 2015/07/04
	 */
    public List<BcLinktype> selectByFriendship(String type) {
    	List<BcLinktype> selectList = this.getSqlSession().selectList(ns+"selectByFriendship",type);
		return selectList;
	}
    /**
	 * 后台：查询出数据的总行数
	 * @time 2015/08/12
	 */
	public int typeLineNumber(String type) {
		return this.getSqlSession().selectOne(ns+"typeLineNumber",type);
	}
	
   /**
	* 后台：查询出数据分页信息
	* @time 2015/08/12
	*/
	public List<BcLinktype> typePaging(Map<String, Object> typepar) {
		return this.getSqlSession().selectList(ns+"typePaging",typepar);
	}
	/**
	* 后台：删除指定的数据
	* @time 2015/08/12
	*/
	public int deleteByPrimaryKey(String id) {
		return this.getSqlSession().delete(ns+"deleteByPrimaryKey",id);
	}

	/**
	* 后台：查询所有的数据
	* @time 2015/08/12
	*/
	public List<BcLinktype> selectAll(String type) {
		return this.getSqlSession().selectList(ns+"selectAll");
	}
	
	/**
	* 后台：存入数据
	* @time 2015/08/13
	*/
	public int insert(BcLinktype record) {
		return this.getSqlSession().insert(ns+"insertSelective",record);
		
	}
	/**
	* 后台：数据修改
	* @time 2015/08/14
	*/
	public int updateByPrimaryKeySelective(BcLinktype record) {
		return this.getSqlSession().update(ns+"updateByPrimaryKeySelective",record);
	}
	
	/**
	* 后台：校验类型名称
	* @time 2015/08/14
	*/
	public BcLinktype checkoutTypeName(Map<String, Object> map) {
		return this.getSqlSession().selectOne(ns+"checkoutTypeName",map);
	}
	
	/**
	* 后台：查询出对应类型名称的id
	* @time 2015/08/18
	*/
	public BcLinktype selectBylinktypeId(String linkType) {
		return this.getSqlSession().selectOne(ns+"selectBylinktypeId",linkType);
	}
	
	public int insertSelective(BcLinktype record) {
		return 0;
	}

	public BcLinktype selectByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	

	public int updateByPrimaryKey(BcLinktype record) {
		// TODO Auto-generated method stub
		return 0;
	}

	

}
